export class UUID {
    static #instance: UUID = null;
    private constructor() {}
    private id: number = 100;
    public static get instance(): UUID {
        if (!UUID.#instance) UUID.#instance = new UUID();
        return UUID.#instance;
    }
    public genID(): number {
        return this.id++;
    }
    private characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    public genRandStringN(n: number): string {
        let result = '';
        const charactersLength = this.characters.length;
        for (let i = 0; i < n; i++) {
            result += this.characters.charAt(Math.floor(Math.random() * charactersLength));
        }
        return result;
    }
    public genRandString(): string {
        return this.genRandStringN(15);
    }
}
